﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class EntityState : AbstractState {
	private string name = null;
	private string commanderPlayerStateId = null;
	
	/*
	 * Hp reflects the health of the entity where a value equal to hpMax is perfect health and 0 is total destruction. A value of -1 equates to hpMax.
	 */
	private int hp = -1;
	
	private float x = -1;
	private float y = -1;

	private float xGoal = -1;
	private float yGoal = -1;
	
	private ReadOnlyableDictionary<Quantifiable,int> quantifiables = new ReadOnlyableDictionary<Quantifiable,int>(); //How many of each resource are stored in the entity.

	public EntityState ()
	{

	}
	
	public string Name
	{
		get
		{
			return name;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			name = value;
		}
	}
	
	public string CommanderPlayerStateId
	{
		get
		{
			return commanderPlayerStateId;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			commanderPlayerStateId = value;
		}
	}
	
	public int Hp
	{
		get
		{
			return hp;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			hp = value;
		}
	}
	
	public float X
	{
		get
		{
			return x;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			x = value;
		}
	}
	
	public float Y
	{
		get
		{
			return y;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			y = value;
		}
	}
	
	public float XGoal
	{
		get
		{
			return xGoal;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			xGoal = value;
		}
	}
	
	public float YGoal
	{
		get
		{
			return yGoal;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			yGoal = value;
		}
	}
	
	public ReadOnlyableDictionary<Quantifiable,int> Quantifiables
	{
		get
		{
			return quantifiables;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			quantifiables = value;
		}
	}
}
